import Home from '../page/home';
import Login from '../page/login'
import Notfound from "../errorPage/404.js"
import Layout from '../page/Layout/index.js'
import Board from '../page/Layout/children/board.js'
import About from '../page/Layout/children/about.js'
import Demo from "../test/useMemo计算属性.js"
//history模式
// import { createBrowserRouter } from 'react-router-dom';
//hash模式 url/#/
import { createHashRouter } from 'react-router-dom';
const router = createHashRouter([
    {
        path: '/',
        element: <Layout />,
        children: [
            {
                path: 'board',     // index:true 加载时默认打开组件
                element: <Board />
            },
            {
                path: 'about',
                element: <About />
            }
        ]
    },
    {
        path: '/home',
        element: <Home />
    },
    {
        path: '/login',
        element: <Login />
    },
    {
        path: '*',
        element: <Notfound />
    },
    // 测试用
    {
        path: '/test',
        element: <Demo />
    },
])

export default router;
